﻿using Anke.SHManage.Model;
using Anke.SHManage.MSSQLDAL;
using Anke.SHManage.MSSQLDAL.TJDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Anke.SHManage.BLL
{
   public class DriverReportBLL
    {
       DriverReportDAL dal = new DriverReportDAL();
       //取司机出车任务列表（用来勾选）
       public object GetTaskInfoForRevisitPick(ref int total, DateTime start, DateTime end, string centerID, string stationID, string workID, string ambulanceCode, string eventDispatchCenterID)
        {
            //DateTime start = TaskDate;
            //DateTime end = TaskDate.AddDays(1);
            return dal.GetDriverReportForPick(ref total, start, end, centerID, stationID, workID, ambulanceCode, eventDispatchCenterID);
        }
       //取实际标识下拉框
       public object Get_ActualCodeList(DateTime start, DateTime end, string workID, string eventDispatchCenterID)
       {
           return dal.Get_ActualCodeList(start, end, workID, eventDispatchCenterID);
       }
       //取车辆相关信息
       public D_DriverReport GetAmbulanceLink(string id)
       {
           return dal.GetAmbulanceLink(id);
       }
       //取收费相关信息   
        public D_DriverReport GetFeeLink(string id)
       {
           return dal.GetFeeLink(id);
       }
        //取收费发票相关信息   
        public D_DriverReport GetFPLink(string id)
        {
            return dal.GetFPLink(id);
        }
       //获取司机
        public object Get_Driver(string id)
        {
            return dal.Get_Driver(id);
        }
       //获取医生
        public object Get_Doctor(string id)
        {
            return dal.Get_Doctor(id);
        }
       //获取护士
        public object Get_Nurse(string id)
        {
            return dal.Get_Nurse(id);
        }
        //获取担架员
        public object Get_Stretcher(string id)
        {
            return dal.Get_Stretcher(id);
        }
        //获取分站车辆
        public object GetStationAmbulance(DateTime start, DateTime end, string stationCode)
        {
            return dal.GetStationAmbulance(start, end, stationCode);
        }
       /// <summary>
       /// 根据人所在的分站
       /// </summary>
       /// <param name="workID"></param>
       /// <returns></returns>
        public string  GetStationByWorkID( string workID)
        {
            //TJDAL tjdal = new TJDAL();

            //return tjdal.GetstaionCodeByWorkCodeTAmbulance(workID);

            return dal.GetStationByWorkID(workID);
        }
       //根据工号获取下班路码和下班油尺
        public D_DriverReport GetoffDuty(string SAmbulance, string ReportDate)
        {
            return dal.GetoffDuty(SAmbulance, ReportDate);
        }

        public object GetReportMainDM(int rows, int page, ref int rowCounts, string zcenterCode, string zstationCode
             , string zPlateNumber, DateTime zReportDateStart, DateTime zReportDateEnd, string zAgentWorkID, string zMoreKM)

        {
            return dal.GetReportMainDM(rows, page, ref  rowCounts, zcenterCode, zstationCode
                 , zPlateNumber, zReportDateStart, zReportDateEnd, zAgentWorkID, zMoreKM);
        }

        #region 移动支付 add2022-01-13 plq 从闵行移植


        //取出每次任务收费详细信息
        public object GetTaskChargeDetail(int rows, int page, ref int total, ref List<TaskChargeDetailInfo> footList, DateTime start, DateTime end, int center, string station, int ifcheck, string invoicenumber, string outtradeno, string patientname)
        {
            return dal.GetTaskChargeDetailNew(rows, page, ref total, ref footList, start, end, center, station, ifcheck, invoicenumber, outtradeno, patientname);

        }
        //获取分中心对账合计
        public object GetCenterChargeCheck(ref int rowtotal, DateTime start, DateTime end)
        {
            return dal.GetCenterChargeCheckNew(ref  rowtotal, start, end);
        }
        //获取分站对账合计
        public object GetStationChargeCheck(ref int rowtotal, DateTime start, DateTime end, string centerCode)
        {
            return dal.GetStationChargeCheckNew(ref rowtotal, start, end, centerCode);
        }
        //获取分站流水对账
        public object GetTaskChargeCheck(ref int rowtotal, ref List<TaskChargeDetailInfo> footList, DateTime start, DateTime end, string stationCode, string ifCheck)
        {
            return dal.GetTaskChargeCheckNew(ref rowtotal, ref footList, start, end, stationCode, ifCheck);
        }



        //财务对账审核(单个)
        public int UpdateChargeAccountCheck(string taskcode)
        {
            return dal.UpdateChargeAccountCheck(taskcode);
        }

        //财务对账撤销审核(单个)
        public int CancelChargeAccountCheck(string taskcode)
        {
            return dal.CancelChargeAccountCheck(taskcode);
        }

        #endregion
    }
}
